<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <base href="/">
  <meta charset="utf-8">
  <title th:text="${index[0].blogSettitles}+' - '+${info.blogTitle}"></title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" th:content="${index[0].blogKeywords}">
  <meta name="description" th:content="${index[0].blogDescription}">
  <link rel="stylesheet" href="res/layui/css/layui.css">
  <link rel="stylesheet" href="res/css/global.css">
</head>
<body>

<div class="fly-header layui-bg-black">
  <div class="layui-container">
    <a class="fly-logo" href="/">
      <img th:src="${index[0].blogLogo}" alt="layui" width="200" height="40">
    </a>

    <ul class="layui-nav fly-nav-user">

      <!-- 未登入的状态 -->
      <!--
      <li class="layui-nav-item">
        <a class="iconfont icon-touxiang layui-hide-xs" href="user/login.html"></a>
      </li>
      <li class="layui-nav-item">
        <a href="user/login.html">登入</a>
      </li>
      <li class="layui-nav-item">
        <a href="user/regist.html">注册</a>
      </li>
      <li class="layui-nav-item layui-hide-xs">
        <a href="/app/qq/" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" title="QQ登入" class="iconfont icon-qq"></a>
      </li>
      <li class="layui-nav-item layui-hide-xs">
        <a href="/app/weibo/" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" title="微博登入" class="iconfont icon-weibo"></a>
      </li>
       -->

      <!-- 登入后的状态 -->
      <li class="layui-nav-item">
        <a class="fly-nav-avatar" href="javascript:;">
          <cite class="layui-hide-xs">贤心</cite>
          <i class="iconfont icon-renzheng layui-hide-xs" title="认证信息：layui 作者"></i>
          <i class="layui-badge fly-badge-vip layui-hide-xs">VIP3</i>
          <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg">
        </a>
        <dl class="layui-nav-child">
          <dd><a href="../user/set.html"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
          <dd><a href="../user/message.html"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a></dd>
          <dd><a href="../user/home.html"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a></dd>
          <hr style="margin: 5px 0;">
          <dd><a href="" style="text-align: center;">退出</a></dd>
        </dl>
      </li>
    </ul>
  </div>
</div>

<div class="layui-hide-xs">
  <div class="fly-panel fly-column">
    <div class="layui-container">
      <ul class="layui-clear">
        <li class="layui-hide-xs"><a href="/">首页</a></li>
      </ul>

      <shiro:user>
        <div class="fly-column-right layui-hide-xs">
          <span class="fly-search"><i class="layui-icon"></i></span>
          <a href="user/findUserBlog" class="layui-btn">发表新帖</a>
        </div>
        <div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;">
          <a href="user/findUserBlog" class="layui-btn">发表新帖</a>
        </div>
      </shiro:user>
    </div>
  </div>
</div>

  <div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8 content detail">
      <div class="fly-panel detail-box">
        <h1 th:text="${info.blogTitle}"></h1>
        <div class="fly-detail-info">
<!--           <span class="layui-badge">审核中</span>-->
          <span class="layui-badge layui-bg-green fly-detail-column">动态</span>

<!--          <span class="layui-badge" style="background-color: #999;">未结</span>
           <span class="layui-badge" style="background-color: #5FB878;">已结</span>

          <span class="layui-badge layui-bg-black">置顶</span>
          <span class="layui-badge layui-bg-red">精帖</span>-->

          <div class="fly-admin-box" data-id="123">
            <!--<span class="layui-btn layui-btn-xs jie-admin" type="del">删除</span>

            <span class="layui-btn layui-btn-xs jie-admin" type="set" field="stick" rank="1">置顶</span>-->
            <!-- <span class="layui-btn layui-btn-xs jie-admin" type="set" field="stick" rank="0" style="background-color:#ccc;">取消置顶</span> -->

           <!-- <span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" rank="1">加精</span>-->
            <!-- <span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" rank="0" style="background-color:#ccc;">取消加精</span> -->
          </div>
          <span class="fly-list-nums">
            <a href="#comment"><i class="iconfont" title="回答">&#xe60c;</i> <b th:text="${contentComment}"></b></a>
            <i class="iconfont" title="人气">&#xe60b;</i> <b th:text="${info.blogViews}"></b>
          </span>
        </div>
        <div class="detail-about">
          <a class="fly-avatar" href="../user/home.html">
            <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" alt="贤心">
          </a>
          <div class="fly-detail-user">
            <a href="/" class="fly-link">
              <b th:if="${info.blogUserUsername==null}">
              <cite>管理员</cite>
              </b>
              <b th:if="${info.blogUserUsername!=null}">
                <cite th:text="${info.blogUserUsername}"></cite>
              </b>
              <i class="iconfont icon-renzheng" title="认证信息：{{ rows.user.approve }}"></i>
              <i class="layui-badge fly-badge-vip">VIP3</i>
            </a>
            <span th:text="${#dates.format(info.blogCreateTime, 'yyyy-MM-dd HH:mm')}"></span>
          </div>
          <div class="detail-hits" id="LAY_jieAdmin" data-id="123">
            <span style="padding-right: 10px; color: #FF7200">悬赏：60飞吻</span>
            <span class="layui-btn layui-btn-xs jie-admin" type="edit"><a href="add.html">编辑此贴</a></span>
          </div>
        </div>
        <div class="detail-body photos">

          <div id="blogContent" hidden="hidden">
            <p th:text="${info.blogContent}"></p>
          </div>
          <div id="desc" name="desc"></div>
        </div>
        <p>提示：</p>
        <pre>
# 2021-1-30
* 本文章不支持转发，如需转发请和作者沟通，否则一切侵权自行承担！
        </pre>
      </div>

      <div class="fly-panel detail-box" id="flyReply">
        <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
          <legend>回帖</legend>
        </fieldset>

        <ul class="jieda" id="jieda">
          <li data-id="111" class="jieda-daan" th:each="comment:${blogComments}">
            <a name="item-1111111111"></a>
            <div class="detail-about detail-about-reply">
              <a class="fly-avatar" href="">
                <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" alt=" ">
              </a>
              <div class="fly-detail-user">
                <a href="" class="fly-link">
                  <cite th:text="${comment.commentName}"></cite>
<!--                  <i class="iconfont icon-renzheng" title="认证信息：XXX"></i>
                  <i class="layui-badge fly-badge-vip">VIP3</i>-->
                </a>

<!--                <span>(楼主)</span>-->
                <!--
                <span style="color:#5FB878">(管理员)</span>
                <span style="color:#FF9E3F">（社区之光）</span>
                <span style="color:#999">（该号已被封）</span>
                -->
              </div>

              <div class="detail-hits">

                <span th:text=" ${#dates.format(comment.commentCreateTime, 'yyyy-MM-dd HH:mm')}"></span>
              </div>

<!--              <i class="iconfont icon-caina" title="最佳答案"></i>-->
            </div>
            <div class="detail-body jieda-body photos">
              <p th:text="${comment.commentContent}"></p>
            </div>
            <div class="jieda-reply">
              <span class="jieda-zan zanok" type="zan">
                <i class="iconfont icon-zan"></i>
                <em>66</em>
              </span>
<!--              <span type="reply">
                <i class="iconfont icon-svgmoban53"></i>
                回复
              </span>-->
<!--              <div class="jieda-admin">
                <span type="edit">编辑</span>
                <span type="del">删除</span>
                 <span class="jieda-accept" type="accept">采纳</span>
              </div>-->
            </div>
          </li>
          <!-- 无数据时 -->
          <!-- <li class="fly-none">消灭零回复</li> -->
        </ul>
        <hr>
        <div class="layui-form layui-form-pane">
          <div layui-form>
            <input type="hidden" name="blogid" th:value="${info.blogId}">
            <div class="layui-form-item">
              <div class="layui-inline">
              <label class="layui-form-label">昵称</label>
              <div class="layui-input-block">
                <input type="text" name="nickname" class="layui-input">
              </div>
            </div>
              <div class="layui-inline">
              <label class="layui-form-label">邮箱</label>
              <div class="layui-input-block">
                <input type="text" name="email" lay-verify="email" class="layui-input">
              </div>
            </div>
            </div>
            <div class="layui-form-item layui-form-text">
              <div class="layui-input-block">
                <textarea name="commentcontent" class="layui-textarea"></textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <input type="hidden" name="jid" value="123">
              <button class="layui-btn" lay-submit lay-filter="LAY-comment-submit">提交回复</button>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="layui-col-md4">
      <dl class="fly-panel fly-list-one">
        <dt class="fly-panel-title">本周热议</dt>
        <dd th:each="bloglist:${blogList}">
          <a th:href="@{'index/indexinfo/'}+${bloglist.blogId}" th:text="${bloglist.blogTitle}"></a>
          <span><i class="iconfont icon-pinglun1"></i> <b th:text="${contentComment}"></b>  </span>
        </dd>
        <!-- 无数据时 -->
        <!--
        <div class="fly-none">没有相关数据</div>
        -->
      </dl>

      <div class="fly-panel">
        <div class="fly-panel-title">
          这里可作为广告区域
        </div>
        <div class="fly-panel-main">
          <a href="http://layim.layui.com/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #5FB878;">LayIM 3.0 - layui 旗舰之作</a>
        </div>
      </div>

      <div class="fly-panel" style="padding: 20px 0; text-align: center;">
        <img src="../../res/images/weixin.jpg" style="max-width: 100%;" alt="layui">
        <p style="position: relative; color: #666;">微信扫码关注 layui 公众号</p>
      </div>

    </div>
  </div>
</div>
</div>

<footer th:replace="footer::header-fragment"></footer>

<script src="res/layui/layui.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  layui.cache.page = 'jie';
  layui.cache.user = {
    username: '游客'
    ,uid: -1
    ,avatar: 'res/images/avatar/00.jpg'
    ,experience: 83
    ,sex: '男'
  };
  layui.config({
    version: "3.0.0"
    ,base: 'res/mods/'
  }).extend({
    fly: 'index'
  }).use(['fly', 'face'], function(){
    var $ = layui.$
            ,fly = layui.fly,form = layui.form;
    //提交
    form.on('submit(LAY-comment-submit)', function(obj){
      //获取表单参数
      var date = obj.field;
      //请求接口
      $.post('index/indexcomment',{
        "blogid":date.blogid,
        "nickname":date.nickname,
        "email":date.email,
        "commentcontent":date.commentcontent
      },function (res){
        if (res.success){
          layer.msg('提交成功，等待审核！', {
            offset: '15px'
            ,icon: 1
            ,time: 1000
          });
        }else {
          layer.msg('提交失败', {
            offset: '15px'
            ,icon: 1
            ,time: 1000
          });
        }
        setTimeout("location.reload()",1000);
      },'json');

      return false;
    });
  });
  $(function() {
    $("#desc").html($("#blogContent").text());
    $("#blogTitle2").html($("#blogTitle").text());
  });
</script>

</body>
</html>